home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / Balloons.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  11.0 KB  |  255 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        Balloons.mod
  3.  
  4.      Contains:    Balloon Help Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE Balloons;
  23.  
  24. IMPORT SYSTEM, Types, Quickdraw, Menus, TextEdit;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31.     hmBalloonHelpVersion*        = $0002;                        (* The real version of the Help Manager *)
  32.     kHMHelpMenuID*                = -16490;                        (* Resource AIFF.ID and menu AIFF.ID of help menu *)
  33.     kHMAboutHelpItem*            = 1;                            (* help menu item number of About Balloon Help… *)
  34.     kHMShowBalloonsItem*            = 3;                            (* help menu item number of Show/Hide Balloons *)
  35.     kHMHelpID*                    = -5696;                        (* AIFF.ID of various Help Mgr package resources (in Pack14 range) *)
  36.     kBalloonWDEFID*                = 126;                            (* Resource AIFF.ID of the WDEF proc used in standard balloons *)
  37. (* Dialog item template type constant *)
  38.     helpItem*                    = 1;                            (* key value in DITL template that corresponds to the help item *)
  39. (* Options for Help Manager resources in LONG("hmnu"), LONG("hdlg"), LONG("hrct"), LONG("hovr"), & LONG("hfdr") resources *)
  40.     hmDefaultOptions*            = 0;                            (* default options for help manager resources *)
  41.     hmUseSubID*                    = 1;                            (* treat resID's in resources as subID's of driver base AIFF.ID (for Desk Accessories) *)
  42.     hmAbsoluteCoords*            = 2;                            (* ignore window port origin and treat rectangles as absolute coords (local to window) *)
  43.  
  44.     hmSaveBitsNoWindow*            = 4;                            (* don't create a window, just blast bits on screen. No update event is generated *)
  45.     hmSaveBitsWindow*            = 8;                            (* create a window, but restore bits behind window when window goes away & generate update event *)
  46.     hmMatchInTitle*                = 16;                            (* for hwin resources, match string anywhere in window title string *)
  47. (* Constants for Help Types in LONG("hmnu"), LONG("hdlg"), LONG("hrct"), LONG("hovr"), & LONG("hfdr") resources *)
  48.     kHMStringItem*                = 1;                            (* pstring used in resource *)
  49.     kHMPictItem*                    = 2;                            (* LONG("PICT") ResID used in resource *)
  50.     kHMStringResItem*            = 3;                            (* LONG("STR#") ResID & index used in resource *)
  51.     kHMTEResItem*                = 6;                            (* Styled Text Edit ResID used in resource (LONG("TEXT") & LONG("styl")) *)
  52.     kHMSTRResItem*                = 7;                            (* LONG("STR ") ResID used in resource *)
  53.     kHMSkipItem*                    = 256;                            (* don't display a balloon *)
  54.     kHMCompareItem*                = 512;                            (* Compare pstring in menu item w/ PString in resource item (LONG("hmnu") only) *)
  55.     kHMNamedResourceItem*        = 1024;                            (* Use pstring in menu item to get LONG("STR#"), LONG("PICT"), or LONG("STR ") resource (LONG("hmnu") only) *)
  56.     kHMTrackCntlItem*            = 2048;                            (* Reserved *)
  57. (* Constants for hmmHelpType's when filling out HMMessageRecord *)
  58.     khmmString*                    = 1;                            (* help message contains a PString *)
  59.     khmmPict*                    = 2;                            (* help message contains a resource AIFF.ID to a LONG("PICT") resource *)
  60.     khmmStringRes*                = 3;                            (* help message contains a res AIFF.ID & index to a LONG("STR#") resource *)
  61.     khmmTEHandle*                = 4;                            (* help message contains a Text Edit handle *)
  62.     khmmPictHandle*                = 5;                            (* help message contains a Quickdraw.Picture handle *)
  63.     khmmTERes*                    = 6;                            (* help message contains a res AIFF.ID to LONG("TEXT") & LONG("styl") resources *)
  64.     khmmSTRRes*                    = 7;                            (* help message contains a res AIFF.ID to a LONG("STR ") resource *)
  65.     kHMEnabledItem*                = 0;                            (* item is enabled, but not checked or control value* = 0 *)
  66.  
  67. (* ResTypes for Styled TE Handles in Resources *)
  68.     kHMTETextResType*            = LONG("TEXT");                        (* Resource Type of text data for styled TE record w/o style info *)
  69.     kHMTEStyleResType*            = LONG("styl");
  70.  
  71.     kHMDisabledItem*                = 1;                            (* item is disabled, grayed in menus or disabled in dialogs *)
  72.     kHMCheckedItem*                = 2;                            (* item is enabled, and checked or control value* = 1 *)
  73.     kHMOtherItem*                = 3;                            (* item is enabled, and control value > 1 *)
  74. (* Method parameters to pass to HMShowBalloon *)
  75.     kHMRegularWindow*            = 0;                            (* Create a regular window floating above all windows *)
  76.     kHMSaveBitsNoWindow*            = 1;                            (* Just save the bits and draw (for MDEF calls) *)
  77.     kHMSaveBitsWindow*            = 2;                            (* Regular window, save bits behind, AND generate update event *)
  78.  
  79. (* Resource Types for whichType parameter used when extracting LONG("hmnu") & LONG("hdlg") messages *)
  80.     kHMMenuResType*                = LONG("hmnu");                        (* Types.ResType of help resource for supporting menus *)
  81.     kHMDialogResType*            = LONG("hdlg");                        (* Types.ResType of help resource for supporting dialogs *)
  82.     kHMWindListResType*            = LONG("hwin");                        (* Types.ResType of help resource for supporting windows *)
  83.     kHMRectListResType*            = LONG("hrct");                        (* Types.ResType of help resource for rectangles in windows *)
  84.     kHMOverrideResType*            = LONG("hovr");                        (* Types.ResType of help resource for overriding system balloons *)
  85.     kHMFinderApplResType*        = LONG("hfdr");
  86.  
  87.  
  88. TYPE
  89.     HMStringResType* = RECORD
  90.         hmmResID*:                INTEGER;
  91.         hmmIndex*:                INTEGER;
  92.     END;
  93.  
  94.     HMMessageRecord* = RECORD
  95.         hmmHelpType*:            Types.SInt16;
  96.         (*ΔΔ CASE INTEGER OF
  97.         0: ( *)
  98.     END;
  99.     HMStringRecPtr* = POINTER TO HMStringRec;
  100.     HMStringRec* = RECORD(HMMessageRecord)
  101.             hmmString*:                    Types.Str255;
  102.            (*ΔΔ );
  103.         1: ( *)
  104.     END;
  105.     HMPictRecPtr* = POINTER TO HMPictRec;
  106.     HMPictRec* = RECORD(HMMessageRecord)
  107.             hmmPict*:                    Types.SInt16;
  108.            (*ΔΔ );
  109.         2: ( *)
  110.     END;
  111.     HMTEHandleRecPtr* = POINTER TO HMTEHandleRec;
  112.     HMTEHandleRec* = RECORD(HMMessageRecord)
  113.             hmmTEHandle*:                TextEdit.TEHandle;
  114.            (*ΔΔ );
  115.         3: ( *)
  116.     END;
  117.     HMStringResRecPtr* = POINTER TO HMStringResRec;
  118.     HMStringResRec* = RECORD(HMMessageRecord)
  119.             hmmStringRes*:                HMStringResType;
  120.            (*ΔΔ );
  121.         4: ( *)
  122.     END;
  123.     HMPictResRecPtr* = POINTER TO HMStringResRec;
  124.     HMPictResRec* = RECORD(HMMessageRecord)
  125.             hmmPictRes*:                    Types.SInt16;
  126.            (*ΔΔ );
  127.         5: ( *)
  128.     END;
  129.     HMPictHandleRecPtr* = POINTER TO HMPictHandleRec;
  130.     HMPictHandleRec* = RECORD(HMMessageRecord)
  131.             hmmPictHandle*:                Quickdraw.PicHandle;
  132.            (*ΔΔ );
  133.         6: ( *)
  134.     END;
  135.     HMTEResRecPtr* = POINTER TO HMTEResRec;
  136.     HMTEResRec* = RECORD(HMMessageRecord)
  137.             hmmTERes*:                    Types.SInt16;
  138.            (*ΔΔ );
  139.         7: ( *)
  140.     END;
  141.     HMSTRResRecPtr* = POINTER TO HMSTRResRec;
  142.     HMSTRResRec* = RECORD(HMMessageRecord)
  143.             hmmSTRRes*:                    Types.SInt16;
  144.            (*ΔΔ );*)
  145.     END;
  146.  
  147.     HMMessageRecPtr* = POINTER TO HMMessageRecord;
  148.  
  149.     TipFunctionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (tip: Types.Point; structure: Quickdraw.RgnHandle; VAR r: Types.Rect; VAR balloonVariant: INTEGER): Types.OSErr;
  150.     TipFunctionUPP* = Types.UniversalProcPtr;
  151.  
  152. CONST
  153.     uppTipFunctionProcInfo* = $00003FE0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  154.  
  155. PROCEDURE NewTipFunctionProc*(userRoutine: TipFunctionProcPtr): TipFunctionUPP;
  156.     (*$IF NOT GENERATINGCFM *)
  157.     INLINE PASCAL $2E9F;
  158.     (*$END*)
  159.  
  160. PROCEDURE CallTipFunctionProc*(tip: Types.Point; structure: Quickdraw.RgnHandle; VAR r: Types.Rect; VAR balloonVariant: INTEGER; userRoutine: TipFunctionUPP): Types.OSErr;
  161.     (*$IF NOT GENERATINGCFM*)
  162.     INLINE PASCAL $205F, $4E90;
  163.     (*$END*)
  164. (*  Public Interfaces  *)
  165.  
  166. PROCEDURE HMGetHelpMenuHandle*(VAR mh: Menus.MenuHandle): Types.OSErr;
  167.     (*$IF NOT GENERATINGCFM*)
  168.     INLINE PASCAL $303C, $0200, $A830;
  169.     (*$END*)
  170. PROCEDURE HMShowBalloon*((*CONST*)VAR aHelpMsg: HMMessageRecord; tip: Types.Point; alternateRect: Types.RectPtr; tipProc: TipFunctionUPP; theProc: Types.SInt16; balloonVariant: Types.SInt16; method: Types.SInt16): Types.OSErr;
  171.     (*$IF NOT GENERATINGCFM*)
  172.     INLINE PASCAL $303C, $0B01, $A830;
  173.     (*$END*)
  174. PROCEDURE HMRemoveBalloon*(): Types.OSErr;
  175.     (*$IF NOT GENERATINGCFM*)
  176.     INLINE PASCAL $303C, $0002, $A830;
  177.     (*$END*)
  178. PROCEDURE HMGetBalloons*(): BOOLEAN;
  179.     (*$IF NOT GENERATINGCFM*)
  180.     INLINE PASCAL $303C, $0003, $A830;
  181.     (*$END*)
  182. PROCEDURE HMSetBalloons*(flag: BOOLEAN): Types.OSErr;
  183.     (*$IF NOT GENERATINGCFM*)
  184.     INLINE PASCAL $303C, $0104, $A830;
  185.     (*$END*)
  186. PROCEDURE HMShowMenuBalloon*(itemNum: Types.SInt16; itemMenuID: Types.SInt16; itemFlags: Types.SInt32; itemReserved: Types.SInt32; tip: Types.Point; alternateRect: Types.RectPtr; tipProc: TipFunctionUPP; theProc: Types.SInt16; balloonVariant: Types.SInt16): Types.OSErr;
  187.     (*$IF NOT GENERATINGCFM*)
  188.     INLINE PASCAL $303C, $0E05, $A830;
  189.     (*$END*)
  190. PROCEDURE HMGetIndHelpMsg*(whichType: Types.ResType; whichResID: Types.SInt16; whichMsg: Types.SInt16; whichState: Types.SInt16; VAR options: Types.UInt32; VAR tip: Types.Point; VAR altRect: Types.Rect; VAR theProc: Types.SInt16; VAR balloonVariant: Types.SInt16; VAR aHelpMsg: HMMessageRecord; VAR count: Types.SInt16): Types.OSErr;
  191.     (*$IF NOT GENERATINGCFM*)
  192.     INLINE PASCAL $303C, $1306, $A830;
  193.     (*$END*)
  194. PROCEDURE HMIsBalloon*(): BOOLEAN;
  195.     (*$IF NOT GENERATINGCFM*)
  196.     INLINE PASCAL $303C, $0007, $A830;
  197.     (*$END*)
  198. PROCEDURE HMSetFont*(font: Types.SInt16): Types.OSErr;
  199.     (*$IF NOT GENERATINGCFM*)
  200.     INLINE PASCAL $303C, $0108, $A830;
  201.     (*$END*)
  202. PROCEDURE HMSetFontSize*(fontSize: Types.UInt16): Types.OSErr;
  203.     (*$IF NOT GENERATINGCFM*)
  204.     INLINE PASCAL $303C, $0109, $A830;
  205.     (*$END*)
  206. PROCEDURE HMGetFont*(VAR font: Types.SInt16): Types.OSErr;
  207.     (*$IF NOT GENERATINGCFM*)
  208.     INLINE PASCAL $303C, $020A, $A830;
  209.     (*$END*)
  210. PROCEDURE HMGetFontSize*(VAR fontSize: Types.UInt16): Types.OSErr;
  211.     (*$IF NOT GENERATINGCFM*)
  212.     INLINE PASCAL $303C, $020B, $A830;
  213.     (*$END*)
  214. PROCEDURE HMSetDialogResID*(resID: Types.SInt16): Types.OSErr;
  215.     (*$IF NOT GENERATINGCFM*)
  216.     INLINE PASCAL $303C, $010C, $A830;
  217.     (*$END*)
  218. PROCEDURE HMSetMenuResID*(menuID: Types.SInt16; resID: Types.SInt16): Types.OSErr;
  219.     (*$IF NOT GENERATINGCFM*)
  220.     INLINE PASCAL $303C, $020D, $A830;
  221.     (*$END*)
  222. PROCEDURE HMBalloonRect*((*CONST*)VAR aHelpMsg: HMMessageRecord; VAR coolRect: Types.Rect): Types.OSErr;
  223.     (*$IF NOT GENERATINGCFM*)
  224.     INLINE PASCAL $303C, $040E, $A830;
  225.     (*$END*)
  226. PROCEDURE HMBalloonPict*((*CONST*)VAR aHelpMsg: HMMessageRecord; VAR coolPict: Quickdraw.PicHandle): Types.OSErr;
  227.     (*$IF NOT GENERATINGCFM*)
  228.     INLINE PASCAL $303C, $040F, $A830;
  229.     (*$END*)
  230. PROCEDURE HMScanTemplateItems*(whichID: Types.SInt16; whichResFile: Types.SInt16; whichType: Types.ResType): Types.OSErr;
  231.     (*$IF NOT GENERATINGCFM*)
  232.     INLINE PASCAL $303C, $0410, $A830;
  233.     (*$END*)
  234. PROCEDURE HMExtractHelpMsg*(whichType: Types.ResType; whichResID: Types.SInt16; whichMsg: Types.SInt16; whichState: Types.SInt16; VAR aHelpMsg: HMMessageRecord): Types.OSErr;
  235.     (*$IF NOT GENERATINGCFM*)
  236.     INLINE PASCAL $303C, $0711, $A830;
  237.     (*$END*)
  238. PROCEDURE HMGetDialogResID*(VAR resID: Types.SInt16): Types.OSErr;
  239.     (*$IF NOT GENERATINGCFM*)
  240.     INLINE PASCAL $303C, $0213, $A830;
  241.     (*$END*)
  242. PROCEDURE HMGetMenuResID*(menuID: Types.SInt16; VAR resID: Types.SInt16): Types.OSErr;
  243.     (*$IF NOT GENERATINGCFM*)
  244.     INLINE PASCAL $303C, $0314, $A830;
  245.     (*$END*)
  246. PROCEDURE HMGetBalloonWindow*(VAR window: Quickdraw.WindowRef): Types.OSErr;
  247.     (*$IF NOT GENERATINGCFM*)
  248.     INLINE PASCAL $303C, $0215, $A830;
  249.     (*$END*)
  250.  
  251. (* $ALIGN RESET*)
  252. (* $POP*)
  253.  
  254.  END Balloons.
  255.